package com.hefeng.wx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hefeng.wx.domain.WxDeviceReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 设备报警信息表;(wx_device_report)表数据库访问层
 * @author :hzh
 * @date : 2022-9-5
 */
@Mapper
public interface WxDeviceReportMapper extends BaseMapper<WxDeviceReport> {
    @Select("SELECT\n" +
            "\twx_device_report.report_time\n" +
            "FROM\n" +
            "\twx_device_report\n" +
            "WHERE\n" +
            "\twx_device_report.device_code = #{deviceCode}\n" +
            "ORDER BY\n" +
            "\twx_device_report.report_time DESC\n" +
            "LIMIT 1 ")
    WxDeviceReport selectByTime(String deviceCode);
}
